//
// CPatchInfo.java
// Copyright (C) 2010  "Naush" <naush _ hotmail _ fr>
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program.  If not, see <http://www.gnu.org/licenses/>./* ----------------------------------------------------------------------------







package org.ryzom.nel.threed;

public class CPatchInfo {
  private long swigCPtr;
  protected boolean swigCMemOwn;

  public CPatchInfo(long cPtr, boolean cMemoryOwn) {
    swigCMemOwn = cMemoryOwn;
    swigCPtr = cPtr;
  }

  public static long getCPtr(CPatchInfo obj) {
    return (obj == null) ? 0 : obj.swigCPtr;
  }

  protected void finalize() {
    delete();
  }

  public synchronized void delete() {
    if (swigCPtr != 0) {
      if (swigCMemOwn) {
        swigCMemOwn = false;
        nel3dJNI.delete_CPatchInfo(swigCPtr);
      }
      swigCPtr = 0;
    }
  }

  public void setPatch(CBezierPatch value) {
    nel3dJNI.CPatchInfo_Patch_set(swigCPtr, this, CBezierPatch.getCPtr(value), value);
  }

  public CBezierPatch getPatch() {
    long cPtr = nel3dJNI.CPatchInfo_Patch_get(swigCPtr, this);
    return (cPtr == 0) ? null : new CBezierPatch(cPtr, false);
  }

  public void setOrderS(short value) {
    nel3dJNI.CPatchInfo_OrderS_set(swigCPtr, this, value);
  }

  public short getOrderS() {
    return nel3dJNI.CPatchInfo_OrderS_get(swigCPtr, this);
  }

  public void setOrderT(short value) {
    nel3dJNI.CPatchInfo_OrderT_set(swigCPtr, this, value);
  }

  public short getOrderT() {
    return nel3dJNI.CPatchInfo_OrderT_get(swigCPtr, this);
  }

  public void setErrorSize(float value) {
    nel3dJNI.CPatchInfo_ErrorSize_set(swigCPtr, this, value);
  }

  public float getErrorSize() {
    return nel3dJNI.CPatchInfo_ErrorSize_get(swigCPtr, this);
  }

  public void setBaseVertices(SWIGTYPE_p_unsigned_int value) {
    nel3dJNI.CPatchInfo_BaseVertices_set(swigCPtr, this, SWIGTYPE_p_unsigned_int.getCPtr(value));
  }

  public SWIGTYPE_p_unsigned_int getBaseVertices() {
    long cPtr = nel3dJNI.CPatchInfo_BaseVertices_get(swigCPtr, this);
    return (cPtr == 0) ? null : new SWIGTYPE_p_unsigned_int(cPtr, false);
  }

  public void setFlags(short value) {
    nel3dJNI.CPatchInfo_Flags_set(swigCPtr, this, value);
  }

  public short getFlags() {
    return nel3dJNI.CPatchInfo_Flags_get(swigCPtr, this);
  }

  public void setNoiseRotation(short value) {
    nel3dJNI.CPatchInfo_NoiseRotation_set(swigCPtr, this, value);
  }

  public short getNoiseRotation() {
    return nel3dJNI.CPatchInfo_NoiseRotation_get(swigCPtr, this);
  }

  public void setCornerSmoothFlag(long corner, boolean smooth) {
    nel3dJNI.CPatchInfo_setCornerSmoothFlag(swigCPtr, this, corner, smooth);
  }

  public boolean getCornerSmoothFlag(long corner) {
    return nel3dJNI.CPatchInfo_getCornerSmoothFlag(swigCPtr, this, corner);
  }

  public void setTiles(SWIGTYPE_p_std__vectorT_NL3D__CTileElement_t value) {
    nel3dJNI.CPatchInfo_Tiles_set(swigCPtr, this, SWIGTYPE_p_std__vectorT_NL3D__CTileElement_t.getCPtr(value));
  }

  public SWIGTYPE_p_std__vectorT_NL3D__CTileElement_t getTiles() {
    long cPtr = nel3dJNI.CPatchInfo_Tiles_get(swigCPtr, this);
    return (cPtr == 0) ? null : new SWIGTYPE_p_std__vectorT_NL3D__CTileElement_t(cPtr, false);
  }

  public void setTileColors(SWIGTYPE_p_std__vectorT_NL3D__CTileColor_t value) {
    nel3dJNI.CPatchInfo_TileColors_set(swigCPtr, this, SWIGTYPE_p_std__vectorT_NL3D__CTileColor_t.getCPtr(value));
  }

  public SWIGTYPE_p_std__vectorT_NL3D__CTileColor_t getTileColors() {
    long cPtr = nel3dJNI.CPatchInfo_TileColors_get(swigCPtr, this);
    return (cPtr == 0) ? null : new SWIGTYPE_p_std__vectorT_NL3D__CTileColor_t(cPtr, false);
  }

  public void setLumels(SWIGTYPE_p_std__vectorT_unsigned_char_t value) {
    nel3dJNI.CPatchInfo_Lumels_set(swigCPtr, this, SWIGTYPE_p_std__vectorT_unsigned_char_t.getCPtr(value));
  }

  public SWIGTYPE_p_std__vectorT_unsigned_char_t getLumels() {
    long cPtr = nel3dJNI.CPatchInfo_Lumels_get(swigCPtr, this);
    return (cPtr == 0) ? null : new SWIGTYPE_p_std__vectorT_unsigned_char_t(cPtr, false);
  }

  public void setTileLightInfluences(SWIGTYPE_p_std__vectorT_NL3D__CTileLightInfluence_t value) {
    nel3dJNI.CPatchInfo_TileLightInfluences_set(swigCPtr, this, SWIGTYPE_p_std__vectorT_NL3D__CTileLightInfluence_t.getCPtr(value));
  }

  public SWIGTYPE_p_std__vectorT_NL3D__CTileLightInfluence_t getTileLightInfluences() {
    long cPtr = nel3dJNI.CPatchInfo_TileLightInfluences_get(swigCPtr, this);
    return (cPtr == 0) ? null : new SWIGTYPE_p_std__vectorT_NL3D__CTileLightInfluence_t(cPtr, false);
  }

  public void setSmoothFlag(long edge, boolean flag) {
    nel3dJNI.CPatchInfo_setSmoothFlag(swigCPtr, this, edge, flag);
  }

  public boolean getSmoothFlag(long edge) {
    return nel3dJNI.CPatchInfo_getSmoothFlag(swigCPtr, this, edge);
  }

  public boolean getNeighborTile(long patchId, long edge, int position, SWIGTYPE_p_unsigned_int patchOut, SWIGTYPE_p_int sOut, SWIGTYPE_p_int tOut, SWIGTYPE_p_std__vectorT_NL3D__CPatchInfo_t patchInfos) {
    return nel3dJNI.CPatchInfo_getNeighborTile(swigCPtr, this, patchId, edge, position, SWIGTYPE_p_unsigned_int.getCPtr(patchOut), SWIGTYPE_p_int.getCPtr(sOut), SWIGTYPE_p_int.getCPtr(tOut), SWIGTYPE_p_std__vectorT_NL3D__CPatchInfo_t.getCPtr(patchInfos));
  }

  public static boolean transform(SWIGTYPE_p_std__vectorT_NL3D__CPatchInfo_t patchInfo, CZoneSymmetrisation zoneSymmetry, CTileBank bank, boolean symmetry, long rotate, float snapCell, float weldThreshold, SWIGTYPE_p_NLMISC__CMatrix toOriginalSpace) {
    return nel3dJNI.CPatchInfo_transform(SWIGTYPE_p_std__vectorT_NL3D__CPatchInfo_t.getCPtr(patchInfo), CZoneSymmetrisation.getCPtr(zoneSymmetry), zoneSymmetry, CTileBank.getCPtr(bank), bank, symmetry, rotate, snapCell, weldThreshold, SWIGTYPE_p_NLMISC__CMatrix.getCPtr(toOriginalSpace));
  }

  public static boolean getTileSymmetryRotate(CTileBank bank, long tile, SWIGTYPE_p_bool symmetry, SWIGTYPE_p_unsigned_int rotate) {
    return nel3dJNI.CPatchInfo_getTileSymmetryRotate(CTileBank.getCPtr(bank), bank, tile, SWIGTYPE_p_bool.getCPtr(symmetry), SWIGTYPE_p_unsigned_int.getCPtr(rotate));
  }

  public static boolean transformTile(CTileBank bank, SWIGTYPE_p_unsigned_int tile, SWIGTYPE_p_unsigned_int tileRotation, boolean symmetry, long rotate, boolean goofy) {
    return nel3dJNI.CPatchInfo_transformTile(CTileBank.getCPtr(bank), bank, SWIGTYPE_p_unsigned_int.getCPtr(tile), SWIGTYPE_p_unsigned_int.getCPtr(tileRotation), symmetry, rotate, goofy);
  }

  public static void transform256Case(CTileBank bank, SWIGTYPE_p_unsigned_char case256, long tileRotation, boolean symmetry, long rotate, boolean goofy) {
    nel3dJNI.CPatchInfo_transform256Case(CTileBank.getCPtr(bank), bank, SWIGTYPE_p_unsigned_char.getCPtr(case256), tileRotation, symmetry, rotate, goofy);
  }

  public void setBindEdges(SWIGTYPE_p_NL3D__CPatchInfo__CBindInfo value) {
    nel3dJNI.CPatchInfo_BindEdges_set(swigCPtr, this, SWIGTYPE_p_NL3D__CPatchInfo__CBindInfo.getCPtr(value));
  }

  public SWIGTYPE_p_NL3D__CPatchInfo__CBindInfo getBindEdges() {
    long cPtr = nel3dJNI.CPatchInfo_BindEdges_get(swigCPtr, this);
    return (cPtr == 0) ? null : new SWIGTYPE_p_NL3D__CPatchInfo__CBindInfo(cPtr, false);
  }

  public CPatchInfo() {
    this(nel3dJNI.new_CPatchInfo(), true);
  }

}
